<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="bean.Product"%>
<%@page import="dao.DaoFactory"%>
<%@page import="service.IProductDao"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">    
    <title>更新产品</title>
    <style>
    	
    	input{
    		border:1px solid RGB(99,175,233);
    	}
    </style>
  </head> 
  <%
  request.setCharacterEncoding("utf-8");
  response.setContentType("text/html;charset=utf-8");
  
  int id =Integer.parseInt(request.getParameter("id"));
 
  Product p = new Product();
  p.setId(id);
  
  IProductDao dao = DaoFactory.getProductDao();
  p=dao.queryById(p);
  
  %>
  <body>
   	<center>
   	<h2>更新产品信息</h2>
   	 <form action="OperatorServlet?op=update" method="post">
   	 	<table border="0" >
   	 		<tr>
   	 			<td>编号</td>
   	 			<td>
   	 			<input type="text" name="id" readonly="readonly" value="<%=p.getId() %>"/>
   	 			</td>
   	 		</tr>
   	 		<tr>
   	 			<td>名称</td>
   	 			<td>
   	 			<input style="color:#7a7a7a" type="text" name="name" value="<%=p.getName()%>"/>
   	 			</td>
   	 		</tr>
   	 		<tr>
   	 			<td>产地</td>
   	 			<td>
   	 			<input style="color:#7a7a7a" type="text" name="addr" value="<%=p.getAddr()%>"/>
   	 			</td>
   	 		</tr>
   	 		<tr>
   	 			<td>价格</td>
   	 			<td>
   	 			<input style="color:#7a7a7a" type="text" name="price" value="<%=p.getPrice()%>"/>
   	 			</td>
   	 	    </tr>
			<tr>
				<td>商品信息</td>
				<td>
					<input style="color:#7a7a7a" type="text" name="shopmsg" value="<%=p.getShopmsg()%>"/>
				</td>
			</tr>
			<tr>
				<td>适用对象</td>
				<td>
					<input style="color:#7a7a7a" type="text" name="object" value="<%=p.getObject()%>"/>
				</td>
			</tr>
   	 			
   	 		
   	 	</table>
   	 	<input type="submit" value="提交"/>&nbsp;&nbsp;
   	 	<input type="reset" value="重置"/>
   	 </form>
   	</center>
  </body>
</html>
